package com.technology.education.ui.common.withdraw_record

import androidx.lifecycle.MutableLiveData
import com.technology.education.data.AppData
import com.technology.education.data.model.DurationWithdrawModel
import com.technology.education.data.model.WithdrawOrderListModel
import com.technology.education.network.apiService
import me.hgj.jetpackmvvm.base.viewmodel.BaseViewModel
import me.hgj.jetpackmvvm.ext.request
import me.hgj.jetpackmvvm.state.ResultState

class WithdrawRecordViewModel : BaseViewModel() {
    val result = MutableLiveData<ResultState<WithdrawOrderListModel>>()
    override fun getData() {
        super.getData()
        request({
            if (AppData.MEMBER_TYPE=="0"){
                apiService.pointWithdrawList(
                    hashMapOf(
                        "pageNo" to pageIndex,
                        "pageSize" to pageSize
                    )
                )
            }else if (AppData.MEMBER_TYPE=="1"){
                apiService.withdrawListTeacher(
                    hashMapOf(
                        "pageNo" to pageIndex,
                        "pageSize" to pageSize
                    )
                )
            }else{
                apiService.withdrawList(
                    hashMapOf(
                        "pageNo" to pageIndex,
                        "pageSize" to pageSize
                    )
                )
            }

        }, result)
    }
}